﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BuildBox.aspx.cs" Inherits="smallDeimos.Game.Controls.BuildBox" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .
        {
            background-color: Black;
            color: Aqua;
        }
        .butt
        {
            font-size: xx-small;
            width: 15px;
            height: 15px;
        }
        #Text1
        {
            width: 45px;
        }
    </style>

    <script language="javascript" src="../../jquery-1.2.6.min.js" type="text/javascript"></script>

    <script language="javascript" type="text/javascript">
// <!CDATA[

function Button1_onclick() {
var text = document.getElementById("Text1");
var val = parseInt(text.value);
if(val < 99)
    val = val + 1;
    
text.value = val.toString();
}

function Button2_onclick() {
var text = document.getElementById("Text1");
var val = parseInt(text.value);
if(val > 1)
    val = val - 1;
    
text.value = val.toString();
}

function Button3_onclick() {
var text = document.getElementById("Text1");
var text2 =document.getElementById("Text2");
var quantity = text.value;
var sId = document.getElementById("HiddenFieldSID");
var pId = document.getElementById("HiddenFieldPID");
var what = document.getElementById("HiddenFieldWhat");
var url = "HandleAjaxCalls.aspx?type=ajax&operation=build&use=pp&sId="+ sId.value+"&pId="+ pId.value+"&what="+what.value+"&q="+quantity;
$.post(url);
}

// ]]>
    </script>

</head>
<body>
    <form id="Form1" runat="server">
    <h3>
        Select number of buldings:</h3>
    <table>
        <tr>
            <td>
                <asp:TextBox ID="Text1" runat="server">1</asp:TextBox>
<%--                <input id="Text1" type="text" maxlength="2" value="1" />
--%>            </td>
            <td>
                <table>
                    <tr>
                        <td>
                            <input id="Button1" type="button" value="+" class="butt" onclick="return Button1_onclick()" />
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <input id="Button2" type="button" value="-" class="butt" onclick="return Button2_onclick()" />
                        </td>
                    </tr>
                </table>
            </td>
            <td>
                <input id="Button3" type="button" value="Use PP" onclick="return Button3_onclick()" />
            </td>
            <td>
            <input id="Button5" type="button" value="Close" class="jqmClose" />
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="HiddenFieldWhat" runat="server" />
    <asp:HiddenField ID="HiddenFieldSID" runat="server" />
    <asp:HiddenField ID="HiddenFieldPID" runat="server" />
    <asp:HiddenField ID="HiddenField4" runat="server" />
    </form>
</body>
</html>
